import request from '@/utils/request'

export function getSignature(url) {
    return request({
        url: '/mobile/wechat/signature',
        method: 'get',
        params: {
            url: url
        }
    });
}

// 获取 access_token
export function getAccessToken() {
    return request({
        url: '/mobile/wechat/accessToken',
        method: 'get'
    });
}

// 获取 jsapi_ticket
export function getJsapiTicket(accessToken) {
    return request({
        url: '/mobile/wechat/jsapiTicket',
        method: 'get',
        params: {
            accessToken: accessToken
        }
    });
}

// 新增：发送模板卡片消息（文本通知型）
export function sendTemplateCard(flowId, url) {
    return request({
        url: '/mobile/wechat/sendTemplateCard/' + flowId, // 对应后端接口路径
        method: 'get',
        params: {
            path: url
        }
    });
}
